package USer;

import Operation.IOperation;
import book.Book;
import book.BookList;
import main.UserNameException;

public abstract class  User {
    private String name="张洋";//用户名
    protected IOperation[] ioPeration;//接口数组
    public  void doWork(int pos, BookList books) {//选择操作
        ioPeration[pos].work(books);
    }
    User(String name) {//构造方法
        this.name = name;
    }
    public  abstract void mnum();//菜单
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
   public  void func(String name1)throws UserNameException {
        if (!name.equals(name1)) {
            throw new UserNameException("用户名错误");
        }
    }

    public User() {
    }
}
